using System;
using System.Collections.Generic;
using System.Text;
using ACS.Compiler.Tables;
using ACS.Compiler.Tables.Modes;

namespace ACS.Compiler.Tree.Impl
{
    public class IntConst : Expression
    {
        private int _value;

        public override void Build()
        {
            _value = Int32.Parse(getFirstChild().ToString());                        
        }

        public override Expressions ExpressionType
        {
            get { return Expressions.IntConst; }
        }

        public override Mode Mode
        {
            get
            {
                return IntMode.Instance;
            }
        }


        public int Value
        {
            get { return _value; }
        }

        public override void Resolve(string ns, DataTable localData)
        {
            // do nothing...
        }

        public override string ToDeclareString()
        {
            return Value.ToString();
        }
    }
}
